package com.z2k.todo.spring;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MySpringV3 {
    private static MySpringV3 me = new MySpringV3();
    private ApplicationContext context;

    private MySpringV3(){
        this.init();
    }

    private void init(){
        String filename = "spring.xml";
        context = new ClassPathXmlApplicationContext(filename);
    }

    public static MySpringV3 getInstance(){
        return me;
    }

    public Object getBean(String name){
        return context.getBean(name);
    }
}
